var vm = new Vue({
    el: "#main",
    data: {
        systemEnquDatas: [],
        versionObj: {
            systemNo: "",
            systemName: "",
            systemChargePop: "",
            systemPhone: "",
            systemPhoneType: "",
            systemUrl: "",
            systemDateUrl: "",
        },

        systemNo: "",
        systemName: "",
        systemChargePop: "",
        // rowNum: 10,

        productCode: "", // 产品编码
        productName: "", // 产品名称
        tipCode: "", // 提示编码
        tipVersion: "", //提示信息版本号
        promptDatas: [],
        nowPage: 1,
        allPages: 0,
        pagination: [],
        pageNum: '',

    },
    mounted: function() {
        this.getData();
    },
    methods: {
        //默认查询
        getData() {
            const _this = this;
            let obj = {
                // pageNo: '10',
                pageNo: this.nowPage,
                pageSize: "10",
                productCode: _this.productCode, // 产品编码
                productName: _this.productName, // 产品名称
                tipCode: _this.tipCode, // 提示编码
                tipVersion: _this.tipVersion, //提示信息版本号
            };
            axios({
                    method: "post",
                    url: App.envUrl.backtrackUrl + "/tipMessage/queryList",
                    data: obj,
                })
                .then((data) => {
                    if (data.data.code === "200") {
                        this.promptDatas = data.data.data[0].date;
                        this.nowPage = data.data.data[0].nowPage;
                        this.allPages = data.data.data[0].allPage;
                        this.pagination = getPagination(this.nowPage, this.allPages);
                    } else {
                        parent.showAlert(data.data.msg);
                    }
                })
                .catch((err) => {});
        },
        //查询
        check_c() {
            this.getData();
        },
        //重置
        check_r() {
            this.productCode = "";
            this.productName = "";
            this.tipCode = "";
            this.tipVersion = "";
            this.getData();
        },
        //新增
        addBtn() {
            window.location.href = "promptadd.html?type=04";
        },
        //维护
        // gotoPage(val) {
        //     console.log(val);
        //     window.location.href = "systemMaintenance.html";
        // },
        //跳转到修改页面
        gotoPage: function(url, item, type) {
            sessionStorage.setItem("promptItem", JSON.stringify(item));
            window.location.href = url + "?type=" + type;
        },
        //分页
        selectPage(page) {
            this.nowPage = page;
            this.getData();
        },
        skipPage() {
        	this.nowPage = parseInt(document.getElementById('page-num').value);
        	document.getElementById('page-num').value = '';
            this.queryApplyList();
        },
        offsetPage(offset) {
            this.nowPage = parseInt(this.nowPage) + parseInt(offset);
            this.getData();
        },
        rowNumChange(val) {
            this.rowNum = Number(val);
            this.getData();
            console.log(val, "11111111111");
        },
    },
});